﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfDemo.Common;
using WpfDemo.ViewModel;
using WpfDemo.ViewModel.Sys;

namespace WpfDemo.View.Sys.Auth
{
    /// <summary>
    /// Index.xaml 的交互逻辑
    /// </summary>
    public partial class Index : Window
    {       
        
        public Index()
        {
            InitializeComponent();
            WindowManager.WindFrmName = this;
            WindowManager.Regiter<Form> ("AuthForm");


            this.DataContext = App.ServiceProvider.GetService<AuthViewModel>();
        }


        public Index(string roleId)
        {
            InitializeComponent();
            WindowManager.WindFrmName = this;
            WindowManager.Regiter<Form>("AuthForm");
            var vm = App.ServiceProvider.GetService<AuthViewModel>();
            this.DataContext = vm;
            vm.RoleId=roleId;
            vm.GetPageList();
        }


    }
}
